/**
 * @Author: yy
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-11-14 18:23:45
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';
//  查询黑名单信息
// status :10041001不在黑名单|10041002已加入黑名单
export const queryBlackModels = params => axios.get(`${SERVER.CLUECENTER}/dealerBlacklist/getDealerBlacklist`, { params: { ...params, status: 10041002 } });
//  查询非黑名单信息(白名单)
// status :10041001不在黑名单|10041002已加入黑名单
export const queryWhiteModels = params => axios.get(`${SERVER.CLUECENTER}/dealerBlacklist/getDealerBlacklist`, { params: { ...params, status: 10041001 } });

//强制清洗任务
export const queryCleanTask = params => axios.get(`${SERVER.CLUECENTER}/cleanTask`, { params});
//强制清洗任务-来源子表信息
export const queryCleanTaskSource = params => axios.get(`${SERVER.CLUECENTER}/cleanTaskSource`, { params});
//强制清洗任务-来源子表信息-新增
export const insertCleanTaskSource = params => axios.post(`${SERVER.CLUECENTER}/cleanTaskSource/insertCleanTaskSource`, { params});



//  强制清洗任务 update
export const updateCleanTask = params => axios.put(`${SERVER.CLUECENTER}/cleanTask`, params);
//强制清洗任务 insertCleanTask
export const insertCleanTask = params => axios.post(`${SERVER.CLUECENTER}/cleanTask`, params);

//强制清洗任务 insertCleanTask
export const deleteCleanTask = id => axios.delete(`${SERVER.CLUECENTER}/cleanTask/${id}`);

//线索来源中文 insertCleanTask
export const getSourcesName = params => axios.post(`${SERVER.CLUECENTER}//jk/clue/getSourcesName`, params);


// 导出黑名单
export const exportDealerBlacklist = params => {
  return axios({
    url: `${SERVER.CLUECENTER}/dealerBlacklist/exportDealerBlacklist`,
    method: 'get',
    params: params,
    responseType: 'blob',
    //60分钟
    timeout: (10 * 1000) * 60
  });
};

//  查询事业部接口
export const getOrgList = params => axios.get(`${SERVER.SYSMANAGE}/org/getOrgList`, { params });

//  加入黑名单
export const updDealerBlacklist = params => axios.post(`${SERVER.CLUECENTER}/dealerBlacklist/updDealerBlacklist`, params);

//  改派经销商
export const addReassign = params => axios.post(`${SERVER.CLUECENTER}/dealerBlacklist/addReassign`, params);
